{% extends 'admin/master.html' %}

{% block body %}
  <style>
   .entry-form-button {
       padding: 4px 8px;
       margin-right: 1.2em;
       margin-left: 1.2em;
   }
   .entry-form-menu {
       padding:8px 10px;
       border-top:0;
       max-width:300px;
       margin: 0 auto;
   }
   .entry-form input {
       padding-left: 3em;
   }
   .entry-form .fa {
       font-size: 1.2em;
       left:5px;
       top:0;
   }
  </style>
  <div class="entry-form-menu">
    {% if current_user.is_authenticated %}
      <a href="{{ url_for("logout") }}"  class="btn btn-sm btn-block btn-default">登出</a>
    {% else %}
      <form class="entry-form">
        <div class="form-group has-feedback">
          <input type="text" class="form-control input-sm" id="username" placeholder="用户名/邮箱">
          <i class="fa fa-envelope-o form-control-feedback"></i>
        </div>
        <div class="form-group has-feedback">
          <input type="password" class="form-control input-sm" id="password" placeholder="密码">
          <i class="fa fa-key form-control-feedback"></i>
        </div>
        <div class="form-group" style="margin-bottom:0;">
          <button type="button" id="entry-login" class="btn btn-sm btn-block btn-default">登陆</button>
        </div>
      </form>
    {% endif %}
  </div>
{% endblock %}

{% block head_tail %}
  {{ super() }}
  <link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" >
{% endblock %}

{% block tail %}
  {{ super() }}
  <script type="text/javascript">
   var g = {
       csrftoken: "{{ csrf_token() }}"
   };
  </script>
  <script type="text/javascript" src="{{ url_for("static", filename="js/login.js") }}"></script>
{% endblock %}
